<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="js/mui.min.js"></script>
	<script src="js/project.js"></script>
    <link href="css/mui.min.css" rel="stylesheet"/>
    <link href="font_ico/iconfont.css" rel="stylesheet"/>
    <link href="css/header.css" rel="stylesheet"/>
	
	<style type="text/css">
	* {
	touch-action: none;
	}
	</style>

</head>
<body>
	<header class="mui-bar mui-bar-nav title">
	    <h1 class="mui-title title-color"><b id="header_title">首页</b></h1>
	</header>
	
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item" title="study" id="study" data="indexdemo.html">
				<span class="mui-icon mui-icon-chatbubble"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" title="develop" data="test.html">
				<span class="mui-icon mui-icon-phone"></span>
				<span class="mui-tab-label">测试</span>
			</a>
			<a class="mui-tab-item" title="index" data="me_setting.html">
				<span class="mui-icon mui-icon-paperplane"></span>
				<span class="mui-tab-label">测试</span>
			</a>
		</nav>
	<script type="text/javascript">
		mui.init();
		// 移动设备就绪完成后
		mui.plusReady(function(){
			plus.navigator.setStatusBarStyle("light");
			plus.navigator.setStatusBarBackground("#303030");
		});
		var subpages = ['indexdemo.html', 'test.html', 'me_setting.html'];
		
		var subpage_style = {
			top: '0px',
			bottom: '45px'
		};
	
		mui.plusReady(function() {
			
			if(flag==true){
			
				console.info("~~~~~~~~~~"+plus.webview.all().length)
			//获取当前窗体
			var self = plus.webview.currentWebview();
			
			for (var i = 0; i < subpages.length; i++) {
				//创建子窗体
				//参数顺序： 窗体内容对应html路径，窗体唯一名字id， 窗体样式， 给窗体传参
				var subview = plus.webview.create(subpages[i], subpages[i], subpage_style, null);
				//子窗台隐藏
				subview.hide();
				//添加子窗体到当前窗体
				self.append(subview);
			}
			//设置默认显示的子窗体
			plus.webview.show('indexdemo.html');
			}else{
				plus.webview.show(subpages[2]);
			}
		});
		mui(".mui-bar-tab").on("tap", "a", function(e) {
			//切换子窗体
			//参数： 窗体id，切换效果，切换时间
			var subid = this.getAttribute("data");
			console.log(subid);
			plus.webview.show(subid, "fade-in", 1000);
		})
	</script>
</body>
</html>